package com.suhe.stock.dao;

import com.suhe.stock.entity.ExponentKLine;
import com.suhe.stock.entity.id.CodeDateIdClass;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.Collection;

@Repository
public interface ExponentKLineDao extends JpaRepository<ExponentKLine, CodeDateIdClass> {

    default void batchSave(Collection<ExponentKLine> exponentKLines) {
        exponentKLines.parallelStream().forEach(exponentKLine -> {
            this.save(exponentKLine);
        });
    }
}
